home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / dev / misc / easyrexx.lha / EasyREXX / Include / libraries / EasyREXX.h
Encoding:
C/C++ Source or Header  |  1994-11-30  |  1.9 KB  |  80 lines

  1. /*
  2.  *    File:                    EasyRexx.h
  3.  *    Description:    Headerfile for the easyrexx.library
  4.  *
  5.  *    (C) 1994, Ketil Hunn
  6.  *
  7.  *    Set Tab=2 for best readability
  8.  *
  9.  */
  10.  
  11. #ifndef EASYREXX_H
  12. #define EASYREXX_H
  13.  
  14. #ifndef    EXEC_PORTS_H
  15. #include <exec/ports.h>
  16. #endif
  17.  
  18. #ifndef UTILITY_TAGITEM_H
  19. #include <utility/tagitem.h>
  20. #endif
  21.  
  22. #define    EASYREXXNAME        "easyrexx.library"
  23. #define    EASYREXXVERSION    1L
  24.  
  25. #define    ER_SIGNAL(c)        (1L<<c->port->mp_SigBit)
  26. //#define ARG(c,i)                (c->argv[i]==NULL ? FALSE:TRUE)
  27. #define ARG(c,i)                (c->argv[i])
  28. #define    ARGNUMBER(c,i)    (*((LONG *)c->argv[i]))
  29. #define    ARGSTRING(c,i)    ((UBYTE *)c->argv[i])
  30. #define    ARGBOOL(c,i)        (c->argv[i]==NULL ? FALSE:TRUE)
  31. #define    TABLE_END                NULL,NULL,NULL,NULL
  32.  
  33. /***** STRUCTS ***********************************************************************/
  34.  
  35. struct ARexxCommandTable
  36. {
  37.     LONG    id;
  38.     UBYTE *command,
  39.                 *template;
  40.     APTR userdata;
  41. };
  42.  
  43. struct ARexxContext
  44. {
  45.     /* PRIVATE */
  46.     struct MsgPort                        *port;
  47.     struct ARexxCommandTable    *table;
  48.     UBYTE                                            *argcopy,
  49.                                                         *portname,
  50.                                                         maxargs;
  51.     struct RDArgs                            *rdargs;
  52.     struct RexxMsg                        *msg;
  53.     ULONG                                            flags;
  54.  
  55.     /* PUBLIC */
  56.     LONG                                            id,
  57.                                                         argv[0];
  58. };
  59.  
  60.  
  61. #ifndef CLIB_EASYREXX_PROTOS_H
  62. #include <clib/easyrexx_protos.h>
  63. #endif
  64.  
  65. #ifndef REXX_ERRORS_H
  66. #include <rexx/errors.h>
  67. #endif
  68.  
  69. /***** TAGS **************************************************************************/
  70.  
  71. #define    ER_TagBase                (TAG_USER)
  72. #define    ER_Portname                (ER_TagBase+1)    /* Name of AREXX port                                            */
  73. #define    ER_CommandTable        (ER_TagBase+2)    /* Table of supported AREXX commands            */
  74. #define    ER_ReturnCode            (ER_TagBase+3)    /* Primary result (return code)                        */
  75. #define    ER_Result1                ER_ReturnCode        /* Alias for ER_ReturnCode                                */
  76. #define    ER_Result2                (ER_TagBase+4)    /* Secondary result                                                */
  77. #define    ER_Port                        (ER_TagBase+5)    /* Use already created port                                */
  78.  
  79. #endif
  80.